package cn.kgc.file.Work.Work05;

import java.io.File;

public class FolderLis {
    public static void main(String[] args) {
        File dir = new File("E:/JAVA高级特性");
        File[] files = dir.listFiles();
        System.out.println("文件：");
        for (File file:files){
            if (file.isFile()){
                System.out.println("\t"+file.getName());
            }
        }
        System.out.println("文件夹：");
        for (File file:files) {
             if (file.isDirectory()){
                 System.out.println("\t"+file.getName());
             }
        }
    }
}
